package com.jwgf.smarowindingmachine_unity.ui;

import com.jwgf.smarowindingmachine_unity.R;

import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;


public class ProductionManagementCustomSelectClassNumberDialog extends Dialog 
		implements OnClickListener {
	
	Context mCtx;

	String[] content={"1","2","3","4","0"};
	
	TextView v1;
	TextView v2;
	TextView v3;
	TextView v4;
	TextView v5;
	
	public ProductionManagementCustomSelectClassNumberDialog(Context context) {
		super(context, R.style.Transparent);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.fragment_production_management_custom_select_class);		
		mCtx = context;
		
		Button btn_close = (Button) findViewById(R.id.btn_close);
		btn_close.setOnClickListener(this);
		 
		v1 = (TextView)findViewById(R.id.v1);
		v2 = (TextView)findViewById(R.id.v2);
		v3 = (TextView)findViewById(R.id.v3);
		v4 = (TextView)findViewById(R.id.v4);
		v5 = (TextView)findViewById(R.id.v5);
		
		v1.setOnClickListener(this);
		v2.setOnClickListener(this);
		v3.setOnClickListener(this);
		v4.setOnClickListener(this);
		v5.setOnClickListener(this);
		
		v1.setText(content[0]);
		v2.setText(content[1]);
		v3.setText(content[2]);
		v4.setText(content[3]);
		v5.setText(content[4]);
	 
	}
	
	@Override
	public void onClick(View v) {
		int id = v.getId();
		switch(id) {
		case R.id.btn_close:
			dismiss();
			break;
		case R.id.v1:
			v1.setTextColor(Color.RED);
			dismiss();			
			break;
		case R.id.v2:
			v2.setTextColor(Color.RED);
			dismiss();	
			break;
		case R.id.v3:
			v3.setTextColor(Color.RED);
			dismiss();			
			break;
		case R.id.v4:
			v4.setTextColor(Color.RED);
			dismiss();	
			break;
		case R.id.v5:
			v5.setTextColor(Color.RED);
			dismiss();	
			break;
		default:
			break;
		}
	}
 
}